1. Field of the Invention
The present invention relates to moving picture coding and decoding technologies, and more particularly, to moving picture coding and decoding technologies using motion compensation.
2. Description of the Related Art
As a representative compression coding system of a moving picture, there is a specification of MPEG-4 AVC/H.264 (hereinafter, referred to as AVC). In the AVC, a motion compensation is used in which a picture is partitioned into rectangular blocks, a picture that has been coded/decoded is set as a reference picture, and a motion from the reference picture is predicted. A technique predicting a motion in accordance with such a motion compensation is called an inter prediction. In the inter prediction according to the AVC, a plurality of pictures can be used as reference pictures, the most appropriate picture is selected from among such a plurality of pictures for each block, and the motion compensation is performed. A reference index is assigned to each reference picture, and the reference picture is specified using the reference index. In addition, in a B picture, maximally two pictures are selected from among reference pictures that have been coded/decoded so as to be used for inter predictions. Such predictions made from the two reference pictures are classified into an L0 prediction (list 0 prediction) that is mainly used for a prediction for the forward direction and an L1 prediction (list 1 prediction) that is mainly used for a prediction for the backward direction.
In addition, a bi-prediction that uses the two inter predictions of the L0 and L1 predictions is defined. In the case of the bi-prediction, bi-directional predictions are made, inter-predicted signals according to the L0 and L1 predictions are multiplied by weighting coefficients, and resultant signals overlap each other with offset values being added thereto, whereby a final inter-prediction picture signal is generated. The weighting coefficients and the offset values used for a weighted prediction are set to representative values in units of pictures for each reference picture of each list and coded. As coding information relating to an inter prediction, for each block, there are a prediction mode specifying both predictions of the L0 prediction and the L1 prediction and, for each reference list of each block, a reference index specifying a reference picture and a motion vector representing the direction of motion and the amount of motion of the block, and such coding information is coded/decoded.
In a moving picture coding system performing the motion compensation, in order to reduce the coding amount of a motion vector generated in each block, a prediction process is performed for the motion vector. According to the AVC, by using a strong correlation between a motion vector of a coding target and motion vectors of neighboring blocks disposed on the periphery thereof, a motion vector predictor is calculated by making a prediction based on the neighboring blocks disposed on the periphery, a motion vector difference that is a difference between the motion vector of the coding target and the motion vector predictor is calculated, and the motion vector difference is coded, whereby the coding amount is reduced.
More specifically, as illustrated in FIG. 34A, a median is calculated based on motion vectors of neighboring blocks A, B, and C disposed on the periphery and is set as a motion vector predictor, and a difference between a motion vector and the motion vector predictor is taken, whereby the coding amount of the motion vector is reduced. However, as illustrated in FIG. 34B, in a case where the sizes or the shapes of the coding target block and neighboring blocks are different from each other, when a plurality of neighboring blocks are present on the left side, an uppermost block out of the neighboring blocks, or when a plurality of neighboring blocks are present on the upper side, a leftmost block out of the neighboring blocks is set as a prediction block, and a prediction is made based on the motion vector of the determined prediction block.
In addition, according to a technology disclosed in Patent Literature 1, a prediction vector is calculated based on motion vectors of a plurality of neighboring blocks of a processing target block and reference picture information, and accordingly, the accuracy of the prediction vector is improved, whereby an increase in the coding amount of a coding vector is suppressed.